home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / misc / sci / Deduce122.lha / Deduce / Deduce.doc < prev    next >
Encoding:
Text File  |  1993-06-07  |  14.5 KB  |  471 lines

  1.                         ***CONTENTS***
  2.                           Deduce 1.22
  3.               by James Williams and Eric Augustine
  4.  
  5.  
  6.   Disclaimer.......................................................  1
  7.   What is Deduce?..................................................  1
  8.   Installation.....................................................  1
  9.   Getting Started..................................................  1
  10.   noreqtools.......................................................  1
  11.   Using Deduce.....................................................  2
  12.   Commands.........................................................  2
  13.   Load.............................................................  2
  14.   Save.............................................................  3
  15.   Why..............................................................  3
  16.   Help.............................................................  3
  17.   Quit.............................................................  3
  18.   Divulge..........................................................  3
  19.   Forget...........................................................  4
  20.   Some notes about the program.....................................  4
  21.   Examples to get you started......................................  4
  22.   To Do............................................................  4
  23.   Known Problems...................................................  5
  24.   History..........................................................  5
  25.   Contacting the Author............................................  6
  26.   Acknowledgements.................................................  6
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.                                 --- C ---
  67. ›Deduce 1.22
  68.  
  69. ***Disclaimer***
  70.  
  71. This program is freeware.  It is being distributed with no warranty.
  72. I can't be held responsible for any damages caused either directly or
  73. indirectly by the use of this program.  Use it at your own risk.
  74.  
  75. This program cannot be sold for profit.  If you wish to use this program
  76. in a commercial distribution, you must first obtain written permission from
  77. me.
  78.  
  79. ***What is Deduce?***
  80.  
  81. Deduce is an experiment in artificial intelligence.  It attempts to simulate
  82. deductive reasoning.  Consider the following example:
  83.  
  84. Spot is a dog.
  85. A dog is an animal.
  86. Therefore, Spot is an animal.
  87.  
  88. Deduce will accept input in the form of English sentences and upon request
  89. will answer yes/no questions about what it has been taught.
  90.  
  91. ***Installation***
  92.  
  93. As of right now, Deduce doesn't have an install script, so you will have
  94. to do the installation manually.  Just copy the ReqTools library to your
  95. libs: directory if you don't already have one there, and then drag
  96. Deduce's drawer icon to where ever you want to put it.  That's it!
  97. Hopefully I will have an install script of some kind by the next release.
  98.  
  99. ***Getting Started***
  100.  
  101. Deduce must be run from the CLI.  Open a CLI or Shell window, cd to the
  102. directory with Deduce, and type Deduce.  At this point, you should see
  103. the program name, my name, and a prompt waiting for input.
  104.  
  105. The syntax for Deduce is:
  106.  
  107. Deduce [options]
  108.  
  109. The options are:
  110.  
  111. - noreqtool
  112.  
  113. For those of you who prefer to use the Workbench, I've included a script
  114. so you can run Deduce (with no options) just by double clicking on the
  115. icon.
  116.  
  117. ***noreqtools***
  118.  
  119. The noreqtools option will disable the use of the ReqTools interface in
  120. favor of the standard CLI interface.
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.                                 --- 1 ---
  132. ***Using Deduce***
  133.  
  134. Most of the time, you will probably be entering statements and asking
  135. questions.  I line of input has the form:
  136.  
  137. subject [helping verb] [verb] object
  138.  
  139. You can also make a statement negative by including the word 'no'.  For
  140. example, you could say "A dog is not a cat."  In fact, the only way
  141. you can ever get a no response to a question is by entering negative
  142. statements.
  143.  
  144. Deduce interprets any statement beginning with a "question" word to be
  145. a question.  If Deduce is unable to find a definite answer to your question,
  146. it will respond with "I don't know".  Sometimes it may seem like Deduce
  147. should know the answer to a question, but it says it doesn't know.
  148. Consider the following example:
  149.  
  150. A liquid will evaporate.
  151. A solid is not a liquid.
  152. Will a solid evaporate?
  153.  
  154. It looks like Deduce should be able to figure out that since a solid is not
  155. a liquid, it won't evaporate.  However, logically, there isn't enough
  156. information given to make that conclusion.  Deduce doesn't know anything
  157. about a solid, and so it doesn't know for sure that it can't evaporate.
  158. Perhaps another example will make this clearer.
  159.  
  160. Water will evaporate.
  161. Alcohol is not water.
  162. Will Alcohol evaporate?
  163.  
  164. This time it should be clear that simply because alcohol is not water doesn't
  165. mean it won't evaporate.
  166.  
  167. When you enter something, Deduce knows the opposite isn't necessarily true.
  168. So if you enter "A cat is not a dog", Deduce won't automatically know that
  169. a dog is not a cat.
  170.  
  171. ***Commands***
  172.  
  173. Aside from entering statements and questions, you can also tell Deduce to
  174. do something for you.  These are the commands it understands.
  175.  
  176. ***  Load   ***
  177. ***  Save   ***
  178. ***  Why    ***
  179. ***  Help   ***
  180. ***  Quit   ***
  181. *** Divulge ***
  182. *** Forget  ***
  183.  
  184. ***Load***
  185.  
  186. Load:
  187.  
  188. Load will load in a previously saved session and add it to what's currently
  189. in memory.  Load is entered on a line by itself, afterwhich you will be
  190. presented with a ReqTools interface to select a file.  If there isn't
  191. enough memory, you will have to enter the filename at a standard CLI
  192. prompt.
  193.  
  194. Note : This doesn't clear the current memory.  If you need to erase what's
  195.        already in memory, use the forget command.
  196.  
  197.                                 --- 2 ---
  198.  
  199. ***Save***
  200.  
  201. Save:
  202.  
  203. To save your work, type save, then select your save-filename using the
  204. ReqTools interface.  If you have insufficient memory, you will have to
  205. enter the filename at a CLI prompt.
  206.  
  207. Save will create a text file containing all the statements you've entered.
  208. If you want to change something you've entered, you can save your work and
  209. edit the save file with any text editor or word processor than can load
  210. and save plain ascii files.  An ampersand (&) marks the end of input, so
  211. you can put comments after it.
  212.  
  213. ***Why***
  214.  
  215. Why:
  216.  
  217. The why command is usually used to let you see the logic behind one of
  218. Deduce's responses to a question.  You must first ask the question, then
  219. enter "why" on a line by itself to see Deduce's reasoning.
  220.  
  221. You may also use the why command if you enter a statement and Deduce
  222. responds with "Yeah, I know" or "That can't be right...".  These
  223. messages mean you tried to enter something that Deduce already knows.
  224. Typing "why" at the next prompt will show you how the information is
  225. known.
  226.  
  227.  
  228. ***Help***
  229.  
  230. Help:
  231.  
  232. The help command will present you with a list of the commands available
  233. and give you a help prompt.  Entering the name of one of the commands
  234. will give you more detailed help on that command, then exit you out of
  235. the help mode.  Thanks to Eric for writing this command.
  236.  
  237. ***Quit***
  238.  
  239. Quit:
  240.  
  241. When you get tired of playing with Deduce, type "quit" to leave the program.
  242. It is synonymous with exit, bye, stop, and end.
  243.  
  244. ***Divulge***
  245.  
  246. Divulge:
  247.  
  248. Divulge will print the entire contents of Deduce's database.  This was
  249. originally put in for debugging purposes, but I decided to leave it in.
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.                                 --- 3 ---
  264. ***Forget***
  265.  
  266. Forget:
  267.  
  268. Forget makes Deduce empty its database.  This can be useful in conjunction
  269. with the load command if you want to completely replace what's in Deduce's
  270. memory.
  271.  
  272. ***Some notes about the program***
  273.  
  274. Deduce tries to interpret your sentence by looking at the position of the
  275. words.  Therefore, it is important to follow a few rules when teaching
  276. Deduce new information.  Your subject and object nouns need to be
  277. one word.  If you have to use more that one word (for an adjective or
  278. whatever) put an underscore character between the words.  This doesn't apply
  279. to articles (a, an, the) and other known words (all, every, ever, of).
  280. Deduce understands negative contractions (don't, doesn't, isn't, aren't,
  281. won't, can't, wasn't, weren't, ain't) as well as no and not.  Deduce isn't
  282. case sensitive, so don't worry about matching case on everything.  Deduce
  283. automatically strips out all punctuation from a sentence.  Words are limited
  284. to 20 characters, and sentences are limited to 20 words and 100 characters.
  285. Anything more will be stripped off.
  286.  
  287. ***Examples to get you started***
  288.  
  289. Here are some examples you can try to get you started.
  290.  
  291. Spot is a dog.
  292. A dog is an animal.
  293. A dog will eat dog_food.
  294. Chunkies is a dog_food.
  295. A cat is an animal.
  296. A dog is not a cat.
  297. Will Spot eat Chunkies?
  298. why
  299. A horse is an animal.
  300. A horse will eat hay.
  301. A horse will drink water.
  302. A horse will not eat meat.
  303. A square is a rectangle.
  304. A rectangle is a polygon.
  305. A liquid will evaporate.
  306. Water is a liquid.
  307. Alcohol is a liquid.
  308.  
  309. ***To Do***
  310.  
  311. - The parser should be able to understand more complex sentences, and be
  312.   able to answer more complex questions (besides the yes/no type).  I
  313.   have some ideas in mind, but I don't know how many of them I will be
  314.   able to implement, so I don't want to say too much just yet.
  315.  
  316. - Sooner or later I will probably have to build a GUI for this program.
  317.   I've never actually written a GUI before, so give me some time.
  318.  
  319. - Build a configuration file.
  320.  
  321. - Buy an 030 + MMU + memory expansion for my 1200 so, among other things,
  322.   I can run enforcer to check my program.  (If anyone finds that this
  323.   program causes enforcer hits, be sure to let me know)
  324.  
  325.  
  326.  
  327.  
  328.  
  329.                                 --- 4 ---
  330. ***Known Problems***
  331.  
  332. - The parse relies on the position of words to determine their part of
  333.   speech, and can therefore easily misinterpret your input.
  334.   e.g. "Green is a good color" <- good will be interpreted as a verb
  335.   (good color should have been written as good_color)
  336.  
  337. - Memory is allocated in small chunks.  This can lead to memory fragmentation
  338.   (fragmentation should be minimal unless you build a huge database)
  339.  
  340. - When asking a question, negative words are ignored, so if you entered
  341.   "Is a dog not a cat", it would be interpreted as "Is a dog a cat".
  342.  
  343. - Sometimes when you ask "why" to a question, the statements will appear in
  344.   a somewhat scrambled order.  I know what's causing this, but fixing it
  345.   would be a bit messy.  And besides, it's not THAT bad, is it?
  346.  
  347. - Since my last upload of Deduce to Aminet, I've had problems with
  348.   the ReqTools interface.  Typing load returns "load cancelled" and typing
  349.   save returns "save cancelled".  If anyone can figure out what's causing
  350.   this (perhaps a memory leak? Enforcer users?), let me know.  If you
  351.  
  352.   have this problem, you can get around it with the noreqtools option: ie
  353.  
  354.   Deduce noreqtools
  355.  
  356. ***History***
  357.  
  358. History:
  359.  
  360. Jan 31, 1995 : version 1.00
  361.     First release
  362.  
  363. Feb 3, 1995 :  version 1.10
  364.   * Added load and save commands
  365.   * Made an AmigaGuide version of the documentation
  366.  
  367. Mar 14, 1995 : version 1.20
  368.   * I accidently limited filenames to 20 characters on the last version.
  369.     Sorry 'bout that.
  370.   * Fixed a bug that would sometimes cause Deduce to respond "I don't know"
  371.     to a question it should know.  For example:
  372.       A horse will not eat meat.
  373.       Pork is a meat.
  374.       Will a horse eat pork?
  375.   * Added some simple online help (actually, Eric added it)
  376.   * Added a forget command to empty Deduce's database
  377.   * Fixed a bug that caused segmentation faults on a Sun Sparc Station
  378.     (This shouldn't affect the Amiga version)
  379.   * Finally broke down and bought SAS C/C++ 6.51. (That's right - I should
  380.     be able to compile that GUI code now ;) )  Since then, I've patched it
  381.     to 6.55.
  382.   * Added code to convert between first and second person.  For example:
  383.       >You are a computer
  384.       Ok.
  385.       >Are you a computer?
  386.       Yes
  387.       >why
  388.       Because:
  389.        I am a computer
  390.     (thanks to Hendrik Fuss for the suggestion)
  391.   * Fixed a bug that caused Deduce problems if you typed 'why' twice in a
  392.     row
  393.   * Added a ReqTools interface for loading and saving
  394.  
  395.                                 --- 5 ---
  396.   * Deduce now uses variable length records for storage, resulting in better
  397.     memory conservation
  398.  
  399. March 17, 1995 : version 1.21 (bugfix)
  400.   * When converting between 1st and 2nd person, Deduce would extract words
  401.     from inside other words: e.g. it would see "you" in "youth" and replace
  402.     it with "Ith" (assuming the sentence was told in second person)
  403.     (thanks to Arthur Hagen for pointing this out)
  404.   * I overlooked a special case with negative logic.  Take for example:
  405.       >I hate spam
  406.       >Vegetables are not spam
  407.       >Do I hate vegetables?
  408.       No
  409.     This has been fixed
  410.     (again, thanks to Arthur Hagen for pointing this out)
  411.   * Added a noreqtools option for the command line.
  412.  
  413. April 14, 1995 : version 1.22 (bugfix)
  414.   * Fixed that enforcer hit.  See up on changes for version 1.20 where
  415.     it says "Fixed a bug that caused segmentation faults on a Sun
  416.     Sparc Station" ?  Well, that code somehow got lost and wasn't
  417.     included in the Amiga version.  And when I upgraded to SAS/C, it
  418.     DID start causing problems. (Thanks Stefan Dube and Simon Stelling)
  419.   * Fixed another problem with negative logic.  Consider the following:
  420.       a dog will eat dog_food
  421.       a cat is not a dog
  422.       will a cat eat dog_food?
  423.     Deduce would answer yes.  This has been fixed. (Thanks Stefan Dube)
  424.   * Deduce no longer prints the blank lines in its output. (suggested by
  425.     Simon Stelling)
  426. ENDNODE
  427.  
  428.  
  429. ***Contacting the Author***
  430.  
  431. If you need to contact me (for comments, questions, suggestions, bug
  432. reports, etc), my email address is :
  433.  
  434.     williamj@griffon.mwsc.edu
  435.  
  436. If you don't have email, my address is:
  437.  
  438.     James Williams
  439.     209 Thomas
  440.     Weston, MO  64098  USA
  441.  
  442. And, if you're lucky, you may even catch me on the #amiga channel on IRC
  443. with the name JamesW.
  444.  
  445. ***Acknowledgements***
  446.  
  447. I would like to thank the following people who helped make Deduce a reality:
  448.  
  449.  The authors of Mind.rexx (util/rexx/Mindrx.lha on Aminet). It was what
  450.  inspired me to write Deduce.
  451.  
  452.  Ronald Carnell, author of "Smart Alec" (Compute! Sept. 1987).  He supplied
  453.  the basic algorithm used in "Smart Alec", which I took and expanded upon
  454.  to create Deduce.
  455.  
  456.  Eric Augustine for helping me to write Deduce.  He wrote the code for
  457.  the help command and has offered to help with the GUI.
  458.  
  459.  Nico Francois for writing the fantastic ReqTools requestor library.
  460.  
  461.                                 --- 6 ---
  462.  
  463.  Everyone who has uploaded programs to the Aminet, as well as Urban Mueller
  464.  for creating the Aminet.  Without such a large source for Amiga software,
  465.  the Amiga would most likely have faded away a long time ago.
  466.  
  467.  And everyone who owns and supports our beloved Amiga computer.  I hope to
  468.  see Amiga business pick up after this #$%?! bidding is over.  Keep up the
  469.  good work, everyone!
  470.  
  471. ÿ